package com.sxpi.chapter.chapter02.card;

import lombok.extern.slf4j.Slf4j;
import org.apache.naming.factory.BeanFactory;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: 董伟豪
 * @Date: 2022/12/31 16:46
 */
@Slf4j
public class CashCard extends BankCard {


    public CashCard(String cardNo, String cardDate) {
        super(cardNo, cardDate);
    }

    @Override
    boolean rule(BigDecimal amount) {
        return false;
    }

    /**
     * 体现
     *
     * @param orderId
     * @param amount
     * @return
     */
    @Override
    public String handleGet(String orderId, BigDecimal amount) {
        log.info("提现成功，单号是：{},金额是：{}", orderId, amount);
        return "123456";
    }


    /**
     * 储蓄
     *
     * @param orderId
     * @param amount
     * @return
     */
    @Override
    public String handlePut(String orderId, BigDecimal amount) {
        log.info("储蓄成功，单号是：{},金额是：{}", orderId, amount);
        return "123456";
    }


    /**
     * 储蓄
     * @return
     */
    @Override
    public List<String> printlnFlow() {
        log.info("交易流水查询成功");
        List<String> lists = List.of("120000", "1120000", "220000", "320000");
        return lists;
    }
}
